package com.zds.support.api.retrofit.function;

import com.zds.support.api.retrofit.exception.ApiException
import com.zds.support.api.retrofit.response.ApiOperaterResponse
import io.reactivex.functions.Function

/**
 *
 * @Description: 服务器结果处理函数
 * @author zc
 * @version V1.0
 */
class ApiOperaterRespResultFunction : Function<ApiOperaterResponse, Boolean> {

    override fun apply(response: ApiOperaterResponse): Boolean {
        //打印服务器回传结果
        if (!response.isSuccess()) {
            throw ApiException(ExceptionEngine.API_RESPONSE_ERROR, response.msg)
        }

        return true
    }
}